package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.SharesMapper;
import com.hello.system.domain.Shares;
import com.hello.system.service.ISharesService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 用户分享记录Service业务层处理
 * 
 * @author hello
 * @date 2025-10-29
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class SharesServiceImpl extends ServiceImpl<SharesMapper, Shares> implements ISharesService 
{
    private final SharesMapper sharesMapper;

    /**
     * 查询用户分享记录
     * 
     * @param shareId 用户分享记录主键
     * @return 用户分享记录
     */
    @Override
    public Shares selectSharesByShareId(Long shareId)
    {
        return sharesMapper.selectSharesByShareId(shareId);
    }

    /**
     * 查询用户分享记录列表
     * 
     * @param shares 用户分享记录
     * @return 用户分享记录
     */
    @Override
    public List<Shares> selectSharesList(Shares shares)
    {
        return sharesMapper.selectSharesList(shares);
    }

    /**
     * 新增用户分享记录
     * 
     * @param shares 用户分享记录
     * @return 结果
     */
    @Override
    public int insertShares(Shares shares)
    {
        shares.setCreateTime(DateUtils.getNowDate());
        return sharesMapper.insertShares(shares);
    }

    /**
     * 修改用户分享记录
     * 
     * @param shares 用户分享记录
     * @return 结果
     */
    @Override
    public int updateShares(Shares shares)
    {
        shares.setUpdateTime(DateUtils.getNowDate());
        return sharesMapper.updateShares(shares);
    }


    /**
     * 批量删除用户分享记录
     * 
     * @param shareIds 需要删除的用户分享记录主键
     * @return 结果
     */
    @Override
    public int deleteSharesByShareIds(Long[] shareIds)
    {
        return sharesMapper.deleteSharesByShareIds(shareIds);
    }

    /**
     * 删除用户分享记录信息
     * 
     * @param shareId 用户分享记录主键
     * @return 结果
     */
    @Override
    public int deleteSharesByShareId(Long shareId)
    {
        return sharesMapper.deleteSharesByShareId(shareId);
    }
}
